require 'erb'

class Base

  def get_options
     return ERB.new(@base_options, 0, '%<>').result(binding)  unless @base_options.nil?
  end

  def get_variables
     return ERB.new(@base_variables, 0, '%<>').result(binding) unless @base_variables.nil?
  end

  def get_transports
     return ERB.new(@base_transports, 0, '%<>').result(binding)  unless @base_transports.nil?
  end

  def get_message(component, filename)
     path = "components/#{component}/#{filename}.txt"
     if File.exist?(path)
        return File.open(path).read
     else
       raise "File does not exist: #{path}"
     end
  end
  
end
